<!-- 全局配置 -->
<template>
  <div class="">
    <p class="title">公共链接配置</p>
    <STable ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" :showPagination="false">
      <template slot="action" slot-scope="row">
        <a-button
          type="primary"
          ghost
          size="small"
          @click="handleCopy(row)"
        >
          插入公众号
        </a-button>
      </template>
    </STable>

    <InsetOfficialAccountModal ref="insetOfficialAccountModal" />
  </div>
</template>

<script>
import { STable } from '@/components'
import InsetOfficialAccountModal from '@/components/InsetOfficialAccountModal/index.vue'

import { AppAllList } from '@/api/web/web'
export default {
  components: {
    STable,
    InsetOfficialAccountModal,
  },
  data() {
    return {
      listLoading: false,
      pageNum: 1,
      pageSize: 10,
      columns: [
        {
          title: '名称',
          dataIndex: 'name',
        },
        {
          title: '链接地址',
          dataIndex: 'linkUrl',
        },
        {
          title: '操作',
          scopedSlots: { customRender: 'action' },
        },
      ],
      loadData: () => {
        return AppAllList().then((res) => {
          this.listLoading = false
          console.log(res);
          return res
        })
      },
    }
  },
  computed: {},
  watch: {},
  methods: {
    handleCopy({ linkUrl }) {
      this.$refs.insetOfficialAccountModal.openModel(linkUrl)
    },
  },
  created() {},
  mounted() {},
}
</script>
<style scoped>
.title {
  font-size: 18px;
  font-weight: bold;
}
</style>